.class public Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;
.super Landroid/widget/LinearLayout;


# instance fields
.field public a:Ljava/util/List;

.field private b:Landroid/widget/TextView;

.field private c:Landroid/widget/ListView;

.field private d:Lcom/waiqin365/lightapp/view/go;

.field private e:Lcom/waiqin365/lightapp/view/gq;


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 1

    invoke-direct {p0, p1}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;)V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-direct {p0}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->b()V

    return-void
.end method

.method public constructor <init>(Landroid/content/Context;Landroid/util/AttributeSet;)V
    .locals 1

    invoke-direct {p0, p1, p2}, Landroid/widget/LinearLayout;-><init>(Landroid/content/Context;Landroid/util/AttributeSet;)V

    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-direct {p0}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->b()V

    return-void
.end method

.method private a(Landroid/widget/ListView;)V
    .locals 6

    const/4 v1, 0x0

    invoke-virtual {p1}, Landroid/widget/ListView;->getAdapter()Landroid/widget/ListAdapter;

    move-result-object v3

    if-nez v3, :cond_0

    :goto_0
    return-void

    :cond_0
    invoke-interface {v3}, Landroid/widget/ListAdapter;->getCount()I

    move-result v4

    move v0, v1

    move v2, v1

    :goto_1
    if-ge v0, v4, :cond_1

    const/4 v5, 0x0

    invoke-interface {v3, v0, v5, p1}, Landroid/widget/ListAdapter;->getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v5

    invoke-virtual {v5, v1, v1}, Landroid/view/View;->measure(II)V

    invoke-virtual {v5}, Landroid/view/View;->getMeasuredHeight()I

    move-result v5

    add-int/2addr v2, v5

    add-int/lit8 v0, v0, 0x1

    goto :goto_1

    :cond_1
    invoke-virtual {p1}, Landroid/widget/ListView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v0

    invoke-virtual {p1}, Landroid/widget/ListView;->getDividerHeight()I

    move-result v1

    invoke-interface {v3}, Landroid/widget/ListAdapter;->getCount()I

    move-result v3

    add-int/lit8 v3, v3, -0x1

    mul-int/2addr v1, v3

    add-int/2addr v1, v2

    iput v1, v0, Landroid/view/ViewGroup$LayoutParams;->height:I

    invoke-virtual {p1, v0}, Landroid/widget/ListView;->setLayoutParams(Landroid/view/ViewGroup$LayoutParams;)V

    goto :goto_0
.end method

.method static synthetic a(Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;)Z
    .locals 1

    invoke-direct {p0}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->c()Z

    move-result v0

    return v0
.end method

.method static synthetic b(Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;)Lcom/waiqin365/lightapp/view/gq;
    .locals 1

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->e:Lcom/waiqin365/lightapp/view/gq;

    return-object v0
.end method

.method private b()V
    .locals 6

    const/16 v5, 0x8

    const/4 v1, 0x0

    invoke-static {}, Lcom/waiqin365/base/login/mainview/a;->a()Lcom/waiqin365/base/login/mainview/a;

    move-result-object v0

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->getContext()Landroid/content/Context;

    move-result-object v2

    invoke-virtual {v0, v2}, Lcom/waiqin365/base/login/mainview/a;->b(Landroid/content/Context;)Ljava/util/HashMap;

    move-result-object v0

    const-string/jumbo v2, "volpicup"

    invoke-virtual {v0, v2}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/HashMap;

    if-eqz v0, :cond_1

    new-instance v2, Lcom/waiqin365/lightapp/b/c;

    invoke-direct {v2}, Lcom/waiqin365/lightapp/b/c;-><init>()V

    const-string/jumbo v3, ""

    iput-object v3, v2, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->getContext()Landroid/content/Context;

    move-result-object v3

    const v4, 0x7f080595

    invoke-virtual {v3, v4}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v2, Lcom/waiqin365/lightapp/b/c;->b:Ljava/lang/String;

    const/4 v3, 0x1

    iput-boolean v3, v2, Lcom/waiqin365/lightapp/b/c;->c:Z

    iget-object v3, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-interface {v3, v2}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    :try_start_0
    new-instance v2, Lorg/json/JSONArray;

    const-string/jumbo v3, "pic_type_data"

    invoke-virtual {v0, v3}, Ljava/util/HashMap;->get(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/lang/String;

    invoke-direct {v2, v0}, Lorg/json/JSONArray;-><init>(Ljava/lang/String;)V

    move v0, v1

    :goto_0
    invoke-virtual {v2}, Lorg/json/JSONArray;->length()I

    move-result v1

    if-ge v0, v1, :cond_0

    new-instance v1, Lcom/waiqin365/lightapp/b/c;

    invoke-direct {v1}, Lcom/waiqin365/lightapp/b/c;-><init>()V

    invoke-virtual {v2, v0}, Lorg/json/JSONArray;->getJSONObject(I)Lorg/json/JSONObject;

    move-result-object v3

    const-string/jumbo v4, "id"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v4

    iput-object v4, v1, Lcom/waiqin365/lightapp/b/c;->a:Ljava/lang/String;

    const-string/jumbo v4, "name"

    invoke-virtual {v3, v4}, Lorg/json/JSONObject;->getString(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v1, Lcom/waiqin365/lightapp/b/c;->b:Ljava/lang/String;

    const/4 v3, 0x0

    iput-boolean v3, v1, Lcom/waiqin365/lightapp/b/c;->c:Z

    iget-object v3, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-interface {v3, v1}, Ljava/util/List;->add(Ljava/lang/Object;)Z
    :try_end_0
    .catch Lorg/json/JSONException; {:try_start_0 .. :try_end_0} :catch_0

    add-int/lit8 v0, v0, 0x1

    goto :goto_0

    :catch_0
    move-exception v0

    invoke-virtual {v0}, Lorg/json/JSONException;->printStackTrace()V

    invoke-virtual {p0, v5}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->setVisibility(I)V

    :cond_0
    :goto_1
    new-instance v0, Lcom/waiqin365/lightapp/view/go;

    invoke-direct {v0, p0}, Lcom/waiqin365/lightapp/view/go;-><init>(Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;)V

    iput-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->d:Lcom/waiqin365/lightapp/view/go;

    invoke-virtual {p0}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->getContext()Landroid/content/Context;

    move-result-object v0

    const v1, 0x7f0301c6

    const/4 v2, 0x0

    invoke-static {v0, v1, v2}, Landroid/view/View;->inflate(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    const v0, 0x7f0c0084

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    iput-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->b:Landroid/widget/TextView;

    const v0, 0x7f0c0199

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/ListView;

    iput-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->c:Landroid/widget/ListView;

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->c:Landroid/widget/ListView;

    iget-object v2, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->d:Lcom/waiqin365/lightapp/view/go;

    invoke-virtual {v0, v2}, Landroid/widget/ListView;->setAdapter(Landroid/widget/ListAdapter;)V

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->c:Landroid/widget/ListView;

    invoke-direct {p0, v0}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a(Landroid/widget/ListView;)V

    invoke-virtual {p0, v1}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->addView(Landroid/view/View;)V

    return-void

    :cond_1
    invoke-virtual {p0, v5}, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->setVisibility(I)V

    goto :goto_1
.end method

.method private c()Z
    .locals 4

    const/4 v2, 0x0

    const/4 v3, 0x1

    move v1, v2

    :goto_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-ge v1, v0, :cond_1

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/b/c;

    iget-boolean v0, v0, Lcom/waiqin365/lightapp/b/c;->c:Z

    if-eqz v0, :cond_0

    :goto_1
    return v2

    :cond_0
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0

    :cond_1
    move v2, v3

    goto :goto_1
.end method


# virtual methods
.method public a()V
    .locals 4

    const/4 v2, 0x0

    move v1, v2

    :goto_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    if-ge v1, v0, :cond_1

    if-nez v1, :cond_0

    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/b/c;

    const/4 v3, 0x1

    iput-boolean v3, v0, Lcom/waiqin365/lightapp/b/c;->c:Z

    :goto_1
    add-int/lit8 v0, v1, 0x1

    move v1, v0

    goto :goto_0

    :cond_0
    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->a:Ljava/util/List;

    invoke-interface {v0, v1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/waiqin365/lightapp/b/c;

    iput-boolean v2, v0, Lcom/waiqin365/lightapp/b/c;->c:Z

    goto :goto_1

    :cond_1
    iget-object v0, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->d:Lcom/waiqin365/lightapp/view/go;

    invoke-virtual {v0}, Lcom/waiqin365/lightapp/view/go;->notifyDataSetChanged()V

    return-void
.end method

.method public setOnPhotoTypeChangeListener(Lcom/waiqin365/lightapp/view/gq;)V
    .locals 0

    iput-object p1, p0, Lcom/waiqin365/lightapp/view/PhotoTypeSelectView;->e:Lcom/waiqin365/lightapp/view/gq;

    return-void
.end method
